General
Cristobal M
1/20/26, 11:55:55 AM EST
I see, the field is there, we don't have a render defined for this field type, let us add one, I'll let you know when is ready
1
👍
Neshovski
12/10/25, 3:19:40 PM EST
It would be good to know if what I pushed is actually well formed, I just jsonencoded a php array.
Cristobal M
12/10/25, 1:27:08 PM EST
Hey Robert, drupalmediausage field is now rendering corrrect in the JSON response
Neshovski
12/10/25, 1:55:33 PM EST
Nice!
With some testing this is how the drupalmediausage "object" looks:
"drupalmediausage": [
{
"synced_reason": "auto_usage",
"site": " ;https://un-news.ddev.site/en",
"media_ids": [198656, 198706, 198705],
"synced_by_id": 0,
"caption_push_done": false,
"other_pages": [
" ;https://un-news.ddev.site/en/story/2025/11/1166313",
" ;https://un-news.ddev.site/en/story/2024/08/1151471",
" ;https://un-news.ddev.site/en/story/2025/11/1166292"
],
"page": " ;https://un-news.ddev.site/en/story/2025/12/1166420",
"synced_by_name": "",
"lang": "en",
"synced_from": "drupal",
"synced_at": "2025-12-10T12:23:13+00:00"
},
{
"synced_reason": "auto_usage",
"site": " ;https://news.un.org/en",
"media_ids": [198656],
"synced_by_id": 0,
"caption_push_done": false,
"other_pages": [],
"page": " ;https://news.un.org/en/story/2025/12/1166420",
"synced_by_name": "",
"lang": "en",
"synced_from": "drupal",
"synced_at": "2025-12-10T18:31:39+00:00"
}
],
It is treating my local and "prod" different, but I am working on defining in config an "identity" for the site that can then be used accross environments.
With some testing this is how the drupalmediausage "object" looks:
"drupalmediausage": [
{
"synced_reason": "auto_usage",
"site": " ;https://un-news.ddev.site/en",
"media_ids": [198656, 198706, 198705],
"synced_by_id": 0,
"caption_push_done": false,
"other_pages": [
" ;https://un-news.ddev.site/en/story/2025/11/1166313",
" ;https://un-news.ddev.site/en/story/2024/08/1151471",
" ;https://un-news.ddev.site/en/story/2025/11/1166292"
],
"page": " ;https://un-news.ddev.site/en/story/2025/12/1166420",
"synced_by_name": "",
"lang": "en",
"synced_from": "drupal",
"synced_at": "2025-12-10T12:23:13+00:00"
},
{
"synced_reason": "auto_usage",
"site": " ;https://news.un.org/en",
"media_ids": [198656],
"synced_by_id": 0,
"caption_push_done": false,
"other_pages": [],
"page": " ;https://news.un.org/en/story/2025/12/1166420",
"synced_by_name": "",
"lang": "en",
"synced_from": "drupal",
"synced_at": "2025-12-10T18:31:39+00:00"
}
],
It is treating my local and "prod" different, but I am working on defining in config an "identity" for the site that can then be used accross environments.
Neshovski
12/10/25, 2:29:47 PM EST
Just to let you know that I am working on improving this. Thank you so much for making this roundtrip!
While I am testing, is there some way I can "delete" the content in the field?
Let me know if we need discuss any concerns or ideas from your side?
While I am testing, is there some way I can "delete" the content in the field?
Let me know if we need discuss any concerns or ideas from your side?
Neshovski
12/10/25, 2:38:36 PM EST
Sorry to repeat - I updated the note above. Is there a way to clear out the field - I am trying to make the data not be "environment" specific, so at the moment I have records that I could either write some code to clear out, or while there is not many records populated, it would be great if I could empty the field quickly via the UI or some other means.
Neshovski
12/10/25, 4:25:31 PM EST
Yup - ended up writing a custom drush un-emedia-clean-usage command - works fine. :)
Cristobal M
12/10/25, 6:33:26 PM EST
Robert we deployed a Button in the botom part of the asset Media Viewer so you can re-run the AI informatics in individual assets.
Neshovski
12/10/25, 7:19:24 PM EST
Hi Cristobal thank you for the button. I will check it out later.
I do have one lingering issue. The API is returning the drupalmediausage still as:
"drupalmediausage": "[{synced_reason=auto_usage, site =https://news.un.org/fr, media_ids=[111801], synced_by_id=0, caption_push_done=false, other_pages=[], page =https://news.un.org/fr/story/2025/01/1152036, synced_by_name=, lang=fr, synced_from=drupal, synced_at=2025-12-11T00:09:32+00:00}]",
It looks ok on the DAM UI, but my code no longer works, it just treats it as non initialized when Json:decode it.
Is this going to remain like this, or can it be corrected to behave like it did earlier today?
I do have one lingering issue. The API is returning the drupalmediausage still as:
"drupalmediausage": "[{synced_reason=auto_usage, site =https://news.un.org/fr, media_ids=[111801], synced_by_id=0, caption_push_done=false, other_pages=[], page =https://news.un.org/fr/story/2025/01/1152036, synced_by_name=, lang=fr, synced_from=drupal, synced_at=2025-12-11T00:09:32+00:00}]",
It looks ok on the DAM UI, but my code no longer works, it just treats it as non initialized when Json:decode it.
Is this going to remain like this, or can it be corrected to behave like it did earlier today?
Neshovski
12/10/25, 7:24:32 PM EST
It looks like this is a Java collection toString() output of a List<Map<String, Object>>. As far as I know, this is not good JSON.
Can this please be fixed?
Can this please be fixed?
Cristobal M
12/11/25, 10:36:02 AM EST
Hello Robert, I think we did not change that (after I fixed the first time). We are using a JSON utility to display it: jsonUtil.toJsonArray($value)
If I validate that JSON in an online validator seems right. It is PHP not taking it as a valid JSON, some tools usually shows the line and position of the error, is PHP showing some of that?
If I validate that JSON in an online validator seems right. It is PHP not taking it as a valid JSON, some tools usually shows the line and position of the error, is PHP showing some of that?
Cristobal M
12/11/25, 10:38:24 AM EST
Oh, wait, I see it is wraped in quotes... maybe that is the problem, let me tak a look
Cristobal M
12/11/25, 11:01:18 AM EST
We found the issue, it was the data-type change we didi yesterday, I set it back to the right data type and now the field is siplaying a valid JSON.
1
😀
Neshovski
12/11/25, 11:32:15 AM EST
YES! Its back now. I am sidelined with some other work, but will try to focus on testing this again later on today. But I do have some personal matters to attend to this afternoon - so likely tomorrow I can do more.
"md5hex": "67a5b4879106d2e8c5e53b303090f4ab",
"drupalmediausage": [
{
"synced_reason": "auto_usage",
"site": " ;https://news.un.org/en",
"media_ids": [198705, 198707, 198656, 198706],
"synced_by_id": 0,
"caption_push_done": false,
"other_pages": [
" ;https://news.un.org/en/story/2025/12/1166420",
" ;https://news.un.org/en/story/2024/08/1151471",
" ;https://news.un.org/en/story/2025/11/1166313"
],
"page": " ;https://news.un.org/en/story/2025/11/1166292",
"synced_by_name": "",
"lang": "en",
"synced_from": "drupal",
"synced_at": "2025-12-10T21:10:02+00:00"
},
{
"synced_reason": "auto_usage",
"site": " ;https://news.un.org/fr",
"media_ids": [124944, 124943],
"synced_by_id": 0,
"caption_push_done": false,
"other_pages": [
" ;https://news.un.org/fr/story/2025/06/1156276"
],
"page": " ;https://news.un.org/fr/story/2025/06/1156546",
"synced_by_name": "",
"lang": "fr",
"synced_from": "drupal",
"synced_at": "2025-12-10T21:12:11+00:00"
}
],
"md5hex": "67a5b4879106d2e8c5e53b303090f4ab",
"drupalmediausage": [
{
"synced_reason": "auto_usage",
"site": " ;https://news.un.org/en",
"media_ids": [198705, 198707, 198656, 198706],
"synced_by_id": 0,
"caption_push_done": false,
"other_pages": [
" ;https://news.un.org/en/story/2025/12/1166420",
" ;https://news.un.org/en/story/2024/08/1151471",
" ;https://news.un.org/en/story/2025/11/1166313"
],
"page": " ;https://news.un.org/en/story/2025/11/1166292",
"synced_by_name": "",
"lang": "en",
"synced_from": "drupal",
"synced_at": "2025-12-10T21:10:02+00:00"
},
{
"synced_reason": "auto_usage",
"site": " ;https://news.un.org/fr",
"media_ids": [124944, 124943],
"synced_by_id": 0,
"caption_push_done": false,
"other_pages": [
" ;https://news.un.org/fr/story/2025/06/1156276"
],
"page": " ;https://news.un.org/fr/story/2025/06/1156546",
"synced_by_name": "",
"lang": "fr",
"synced_from": "drupal",
"synced_at": "2025-12-10T21:12:11+00:00"
}
],
Cristobal M
12/11/25, 12:31:19 PM EST
Hey Robert, Shakil finished the new Translate integration, now we have Kiswahili available, we did couple test on assets and they look great, give it a try and let us know when you have a chance.
Processing...